package com.estar.assistsurvy.thread;

import com.estar.assistsurvy.constant.Constants;
import com.estar.assistsurvy.entity.RequestOnlineQueryQuestions;
import com.estar.assistsurvy.entity.ResponseQueryQuestions;
import android.content.Context;
import android.os.Handler;
import android.util.Log;

public class QueryQuestionsThread extends BaseThread {

	private RequestOnlineQueryQuestions queryQuestions;
	
	public QueryQuestionsThread(Context context, RequestOnlineQueryQuestions queryQuestions,
			Handler handler) {
		super(context, handler);
		this.queryQuestions = queryQuestions;
	}
	
	@Override
	public void run() {
		// TODO Auto-generated method stub
		url_str=Constants.NAMESPACE+Constants.ONLINEQUARYQUESTIONS;
		json=gson.toJson(queryQuestions);
		postRequest(url_str, json);
		if(result!=null){
			ResponseQueryQuestions queryQuestions=new ResponseQueryQuestions();
			queryQuestions=gson.fromJson(result, ResponseQueryQuestions.class);
			
			msg.obj=queryQuestions;
			msg.what=0;
			msg.sendToTarget();
			Log.i("wl", "在线答题题库网络请求返回值"+result);
		}
	}
	
}
